/*
 * $Id$
 */
package corejs.rt;

public class Object_ {
   
   public static Invocable newInstance() {
      return new Invocable("Object") {{
            
            // Object.create
            store("create", new F2() {
               @Override
               Value invoke(final ExecutionContext ec) {
                  final Value proto = ec.get(_arg1_);
                  return new Obj(proto.isUndefined() ? null : proto);
               }
            });
            
            // Object.getPrototypeOf
            store("getPrototypeOf", new F1() {
               @Override
               Value invoke(final ExecutionContext ec) {
                  return ec.get(_arg_).proto();
               }
            });
            
            store("prototype", Obj.prototype);
                                         
         } // _END_OF_initializer
         
         
         @Override
         Value invoke(final ExecutionContext ec) {
            return null;
         }
      };
   }
}
